<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<script type="text/javascript" language="JavaScript" src="js/global.js"></script>
<script type="text/javascript">
function _verify(obj,key){
	
	if(key == 1){
		displayMethod(obj,'verify_card_1');
		displayMethod(obj,'verify_cardpic_1');
	}else if(key == 2){
		displayMethod(obj,'verify_alipay_2');
	}else if(key == 4){
	}else if(key == 8){
		displayMethod(obj,'verify_other_8');
	}
}
function displayMethod(check,id){
	var obj = getObj(id);
	if(check.checked){
		obj.style.display = "";
	}else{
		obj.style.display = "none";
	}
}
var status;
function active(action ,obj){

	var msg_y = getObj('ifmsg_y');
	var msg_n = getObj('ifmsg_n');
	if(action == 'add'){
		if(obj.value == 1) { 
			msg_y.checked = true;
			msg_y.click();
		}else{ 
			msg_n.checked = true
			msg_n.click();
		}
	}else if(action == 'edit'){
		if(obj.value != status){
			msg_y.checked = true;
			msg_y.click();
		}else{
			msg_n.checked = true;
			msg_n.click();
		}
	}
}

window.onload = function(){
	var ifactive_y = getObj("ifactive_y");
	var ifactive_n = getObj("ifactive_n");
	status = ifactive_y.checked ? ifactive_y.value : ifactive_n.value;
}
</script>
<div class="nav3 mb10">
    <ul class="cc">
        <li $nav[manager]>
        	<a hidefocus="true" href="$basename&type=manager">经纪人管理</a>
        </li>
    </ul>
</div>
<h2 class="h1">$title</h2>
<form action="{$basename}&action=$action" method="post" enctype="multipart/form-data">
<input type="hidden" name="step" value="2"/>
<input type="hidden" name="uid" value="{$brokerModule->uid}"/>
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr1">
			<td class="td1">用户名<span class="s1">*</span></td>
			<td class="td2">
			<input type="text" class="input input_wa" name="username" value="{$brokerModule->username}" $readonly/>
			</td>
		</tr>
		<tr class="tr1">
			<td class="td1">姓名<span class="s1">*</span></td>
			<td class="td2"><input type="text" class="input input_wa" name="realname" value="{$brokerModule->realname}" /></td>
		</tr>
		<tr class="tr1">
			<td class="td1">经纪人组头衔</td>
			<td class="td2">
				<select class="select_wa" name="groupid">
<!--
EOT;
foreach ($groups as $key => $value) {
$_selected = $value['groupid'] == $brokerModule->groupid ? 'selected' : '';
print <<<EOT
-->
				<option value="{$value['groupid']}" $_selected>{$value['name']}</option>
<!--
EOT;
}print <<<EOT
-->		
				</select>
			</td>
		</tr>		
		<tr class="tr1">
			<td class="td1">服务商圈</td>
			<td class="td2">
				<ul class="list_A list_120" style="width:100%">
<!--
EOT;
foreach ($plateField as $key => $value) {
$plate = $brokerModule->plate;
$checked = in_array($key,$plate) ? 'checked' : '';
print <<<EOT
-->				
					<li><input type="checkbox" name="plate[]" value="$key" $checked/>{$value}</li>
<!--
EOT;
}print <<<EOT
-->	
				</ul>
			</td>
		</tr>
		<tr class="tr1">
			<td class="td1">所属公司</td>
			<td class="td2"><input type="text" class="input input_wa" name="company" value="{$brokerModule->company}"/></td>
		</tr>
		<tr class="tr1">
			<td class="td1">工作地址</td>
			<td class="td2">
				<input type="text" class="input input_wa" name="address" value="{$brokerModule->address}"/>
			</td>
		</tr>
		<tr class="tr1">
			<td class="td1">手机号码</td>
			<td class="td2">
				<input type="text" class="input input_wa" name="phone" value="{$brokerModule->phone}" />
				<span class="tips">固定电话与手机号码至少填写一项</span>
			</td>
		</tr>		
		<tr class="tr1">
			<td class="td1">固定电话</td>
			<td class="td2">
				<input type="text" class="input input_wa" name="tel" value="{$brokerModule->tel}"/>
				<span class="tips">固定电话与手机号码至少填写一项</span>
			</td>
		</tr>
		<tr class="tr1">
			<td class="td1">认证类型</td>
			<td class="td2">
				<ul class="list_A list_120" style="width:100%">
<!--
EOT;
foreach ($brokerModule->verifyInfo as $key => $value) {
$_checked = $value[check]? 'checked' : '';
if(!$_checked &&  $action == 'add' && $key == 8){
	$_checked = 'checked';
}
if($key == 1){
	$cardDisplay = $_checked ? '' : 'display:none';
}elseif($key == 2){
	$alipayDisplay = $_checked ? '' : 'display:none';
}elseif($key == 4){
	$phoneDisplay = $_checked ? '' : 'display:none';
}elseif($key == 8){
	$otherDisplay = $_checked ? '' : 'display:none';
}
print <<<EOT
-->				
					<li><input type="checkbox" id="_verify_{$key}" name="_verify[$key]" $_checked onclick="_verify(this,$key)"/>$value[name]</li>
<!--
EOT;
}print <<<EOT
-->					
				</ul>
			</td>
		</tr>
		<tr class="tr1" id="verify_card_1" style="$cardDisplay">
			<td class="td1">身份证号码</td>
			<td class="td2">
				<input type="text" class="input input_wa" name="idcard" value="{$brokerModule->idcard}"/>
			</td>
		</tr>
		<tr class="tr1" id="verify_cardpic_1" style="$cardDisplay">
			<td class="td1">身份证</td>
			<td class="td2">
				<input type="file" name="idcardpic" />
<!--
EOT;
print <<<EOT
-->					
				<img src="{$brokerModule->idcardpic}" width="200" height="100"/>
<!--
EOT;
print <<<EOT
-->
			</td>
		</tr>
		<tr class="tr1" id="verify_alipay_2" style="$alipayDisplay">
			<td class="td1">支付宝账号</td>
			<td class="td2">
				<input type="text" class="input input_wa" name="alipay" value="{$brokerModule->alipay}" />
			</td>
		</tr>
		<tr class="tr1" id="verify_other_8" style="$otherDisplay">
			<td class="td1">其他认证信息</td>
			<td class="td2">
				<textarea class="textarea" name="otherinfo">{$brokerModule->otherinfo}</textarea>
			</td>
		</tr>
		<tr class="tr1">
			<td class="td1">备注</td>
			<td class="td2"><textarea class="textarea" name="remark">{$brokerModule->remark}</textarea></td>
		</tr>
			
		<tr class="tr1">
			<td class="td1">状态</td>
			<td class="td2">
				<ul class="list_A list_120" style="width:100%">
					<li><input id="ifactive_y"  type="radio" name="ifactive" value="1" $ifactive_Y onclick="active('$action',this)"/>激活</li>
					<li><input id="ifactive_n"  type="radio" name="ifactive" value="0" $ifactive_N onclick="active('$action',this)"/>锁定</li>
				</ul>
			</td>
		</tr>
		<tr class="tr1">
			<td class="td1">消息通知</td>
			<td class="td2">
				<ul class="list_A list_120" style="width:100%">
					<li><input id="ifmsg_y" type="radio" name="ifmsg" value="1" $ifmsg_Y/>开启</li>
					<li><input id="ifmsg_n" type="radio" name="ifmsg" value="0" $ifmsg_N/>关闭</li>
				</ul>
			</td>
		</tr>
	</table>
</div>

<div class="mb10 tac">
	<span class="btn"><span><button onfocus="blur();" type="submit">提 交</button></span></span>
</div>
</form>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->